﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AMG.Common;
using System.Data;
using System.Data.SqlClient;
using AMG.DALProfile;


namespace AMG.Web.ajax
{
    public partial class checkpwd : AMG.Web.UI.Page.UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string password = Request.QueryString["password"];
            try
            {
                string pwd = string.Empty;
                SqlParameter param = new SqlParameter("@UserID", UserID);
                string Sql = "select Password from AMG_Proxy where ID=@UserID";
                IDataReader rd = DbHelper.ExecuteReader(CommandType.Text, Sql, param);
                if (rd.Read())
                {
                    pwd = rd.GetString(0);
                }
                rd.Close();
                if (Input.MD5Valid(pwd, password))
                    Response.Write("1");
                else
                    Response.Write("0");
            }
            catch 
            {
                Response.Write("0");
            }
            Response.End();
            return;
        }
    }
}
